home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr57 / elnk3.zip / OEMSETUP.INF < prev    next >
INI File  |  1993-06-10  |  43KB  |  1,494 lines

  1. ;***********************************************************************
  2. ;
  3. ; OEMNADE2.INF
  4. ;
  5. ;       Elink II network card and driver SETUP INF file.
  6. ;
  7. ; History:
  8. ;***********************************************************************
  9.  
  10. ;-----------------------------------------------------------------------
  11. ; OPTION TYPE
  12. ; -----------
  13. ; This identifies the Option type we are dealing with.  The different
  14. ; possible types are:
  15. ;
  16. ; COMPUTER, DISPLAY, MOUSE, KEYBOARD, LAYOUT, SCSI, PRINTER, ...
  17. ;
  18. ;  Types specific to networking:
  19. ;
  20. ; NetAdapter,        a netcard / adapter combination or just a netcard
  21. ; NetDriver,         just a netcard driver
  22. ; NetTransport,      a complete NDIS-compliant TDI transport stack
  23. ; NetService,        an NT networking service
  24. ; NetWork,           a complete network ensemble.
  25. ; NetProvider        a complete network which supports NT MPR protocol
  26. ;-----------------------------------------------------------------------
  27.  
  28. [Identification]
  29.     OptionType = NetAdapter
  30.  
  31. ;-----------------------------------------------------------------------
  32. ; PlatformsSupported
  33. ; ------------------
  34. ; This identifies the platforms supported by the adapter card.
  35. ; Possible types are:
  36. ;
  37. ; ISA, EISA and MCA
  38. ;-----------------------------------------------------------------------
  39.  
  40. [PlatformsSupported]
  41.     ISA
  42.     EISA
  43.     MCA
  44.  
  45. ;-----------------------------------------------------------------------
  46. ; OPTION LIST
  47. ; -----------
  48. ; This section lists the OEM Option key names.  These keys are locale
  49. ; independent and used to represent the option in a locale independent
  50. ; manner.
  51. ;
  52. ;-----------------------------------------------------------------------
  53.  
  54. [Options]
  55.     ELNK3
  56.  
  57. ;***********************************************************************
  58. ; CONSTANTS FOR USING DIALOGS
  59. ;***********************************************************************
  60.  
  61. [FileConstants]
  62.  
  63.  
  64. GenericInfVersion  = " v2.05"
  65. GenericAdapterName = "Etherlink III Ethernet Adapter"
  66. GenericDriverName  = "Etherlink III Ethernet Adapter Driver"
  67. GenericSysName     = "elnk3.sys"
  68. GenericName        = "ELNK3"
  69.  
  70.  
  71.  
  72. ;
  73. ;  File names, etc.
  74. ;
  75. UtilityInf      = "UTILITY.INF"
  76. ParamInf        = "NCPARAM.INF"
  77. subroutineinf   = "SUBROUTN.INF"
  78. SoftwareType    = "driver"
  79. Exit_Code       = 0
  80.  
  81. ;
  82. ; EventLog Message File
  83. ;
  84. NetEventDLL     = "%SystemRoot%\System32\netevent.dll"
  85. IoLogMsgDLL     = "%SystemRoot%\System32\IoLogMsg.dll"
  86.  
  87. ; Product Info
  88. ;
  89. Manufacturer    = "Microsoft"
  90. ProductMajorVersion     = "3"
  91. ProductMinorVersion     = "1"
  92. ProductVersion  = $(ProductMajorVersion)"."$(ProductMinorVersion)
  93.  
  94. ;
  95. ; Software
  96. ;
  97. ProductSoftwareName     = "ELNK3"
  98. ProductSoftwareImagePath = "\SystemRoot\System32\drivers\"$(GenericSysName)
  99. NetRuleSoftwareType     = "elnk3Sys ndisDriver elnk3Driver"
  100.  
  101. NetRuleSoftwareUse      = $(SoftwareType)
  102. NetRuleSoftwareBindForm = """elnk3Sys"" yes no container"
  103.  
  104. NetRuleSoftwareClass    = {"elnk3Driver basic"}
  105. NetRuleSoftwareBindable = {"elnk3Driver elnk3Adapter non exclusive 100"}
  106. ;
  107. ; Hardware
  108. ;
  109. ProductHardwareName        = "ELNK3"
  110. NetRuleHardwareType        = "elnk3 elnk3Adapter"
  111. NetRuleHardwareBindForm    = " yes yes container"
  112. NetRuleHardwareClass       = {"elnk3Adapter basic"}
  113.  
  114.  
  115.  
  116. ;
  117. ; Registry Key
  118. ;
  119. ProductKeyName  = $(!NTN_SoftwareBase)"\"$(Manufacturer)"\"$(ProductSoftwareName)"\CurrentVersion"
  120. ParamKeyName    = $(!NTN_ServiceBase)"\"$(ProductHardwareName)"\Parameters"
  121.  
  122.  
  123. [GeneralConstants]
  124. ;
  125. ;  Program flow control variables.
  126. ;
  127. from      = ""
  128. to        = ""
  129. ;
  130. ;  Return codes; Exit_Code is set to one of these
  131. ;
  132. ExitCodeOk     = 0
  133. ExitCodeCancel = 1
  134. ExitCodeFatal  = 2
  135.  
  136. KeyNull         = ""
  137. MAXIMUM_ALLOWED   = 33554432
  138. RegistryErrorIndex = NO_ERROR
  139. KeyProduct      = ""
  140. KeyParameters   = ""
  141.  
  142. TRUE            = 1
  143. FALSE           = 0
  144. NoTitle            = 0
  145.  
  146. ExitState   = "Active"
  147. OldVersionExisted = $(FALSE)
  148.  
  149. DriverPath      = $(!STF_NTPATH)\drivers
  150.  
  151. [date]
  152.     ; Now is a list which contains { Sec from 1-1-1970, Year, Month, Day, Hour,
  153.     ; Minute, Second }
  154.     Now = {} ? $(!LIBHANDLE) GetSystemDate
  155.  
  156.  
  157. ;---------------------------------------------------------------------------
  158. ; 1. Identify
  159. ;
  160. ; DESCRIPTION:   To verify that this INF deals with the same type of options
  161. ;                as we are choosing currently.
  162. ;
  163. ; INPUT:         None
  164. ;
  165. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL
  166. ;                $($R1): Option Type (COMPUTER ...)
  167. ;                $($R2): Diskette description
  168. ;---------------------------------------------------------------------------
  169.  
  170. [Identify]
  171.     ;
  172.     ;
  173.     read-syms Identification
  174.  
  175.     set Status     = STATUS_SUCCESSFUL
  176.     set Identifier = $(OptionType)
  177.     set Media      = #("Source Media Descriptions", 1, 1)
  178.  
  179.     Return $(Status) $(Identifier) $(Media)
  180.  
  181. ;------------------------------------------------------------------------
  182. ; 2. ReturnOptions:
  183. ;
  184. ; DESCRIPTION:   To return the option list supported by this INF and the
  185. ;                localised text list representing the options.
  186. ;
  187. ;
  188. ; INPUT:         $($0):  Language used. ( ENG | FRN | ... )
  189. ;
  190. ; OUTPUT:        $($R0): STATUS: STATUS_SUCCESSFUL |
  191. ;                                STATUS_NOLANGUAGE
  192. ;                                STATUS_FAILED
  193. ;                                STATUS_NOTSUPPORTED
  194. ;
  195. ;                $($R1): Option List
  196. ;                $($R2): Option Text List
  197. ;------------------------------------------------------------------------
  198.  
  199. [ReturnOptions]
  200.     ;
  201.     ;
  202.     set Status        = STATUS_FAILED
  203.     set OptionList     = {}
  204.     set OptionTextList = {}
  205.  
  206.     ;
  207.     ; Check if the language requested is supported
  208.     ;
  209.     set LanguageList = ^(LanguagesSupported, 1)
  210.     Ifcontains(i) $($0) in $(LanguageList)
  211.         ;
  212.         ; Check if the platforms requested is supported
  213.         ;
  214.         ifstr(i) $($1) == ""
  215.                         goto returnoptions
  216.         endif
  217.  
  218.         set PlatformList = ^(PlatformsSupported, 1)
  219.         Ifcontains(i) $($1) in $(PlatformList)
  220.                         goto returnoptions
  221.         else
  222.                         set Status = STATUS_NOTSUPPORTED
  223.                         goto finish_ReturnOptions
  224.         endif
  225.     else
  226.                 set Status = STATUS_NOLANGUAGE
  227.                 goto finish_ReturnOptions
  228.     endif
  229.  
  230.     ;
  231.     ; form a list of all the options and another of the text representing
  232.     ;
  233.  
  234. returnoptions = +
  235.     set OptionList     = ^(Options, 1)
  236.     set OptionTextList = ^(OptionsText$($0), 1)
  237.     set Status         = STATUS_SUCCESSFUL
  238.  
  239. finish_ReturnOptions = +
  240.     Return $(Status) $(OptionList) $(OptionTextList)
  241.  
  242. ;------------------------------------------------------------------------
  243. ;
  244. ; InstallOption:
  245. ;
  246. ;      This section is shelled to by main installation processing
  247. ;      or by NCPASHEL.INF during reconfig, removal, update, etc.
  248. ;
  249. ;
  250. ; FUNCTION:  To copy files representing Options
  251. ;            To configure the installed option
  252. ;            To update the registry for the installed option
  253. ;
  254. ; INPUT:     $($0):  Language to use
  255. ;            $($1):  OptionID to install
  256. ;            $($2):  SourceDirectory
  257. ;            $($3):  AddCopy  (YES | NO)
  258. ;            $($4):  DoCopy   (YES | NO)
  259. ;            $($5):  DoConfig (YES | NO)
  260. ;
  261. ; OUTPUT:    $($R0): STATUS: STATUS_SUCCESSFUL |
  262. ;                            STATUS_NOLANGUAGE |
  263. ;                            STATUS_USERCANCEL |
  264. ;                            STATUS_FAILED
  265. ;
  266. ;------------------------------------------------------------------------
  267. [InstallOption]
  268.     ;
  269.     ; Set default values for
  270.     ;
  271.     set Status   = STATUS_FAILED
  272.     ;
  273.     ; extract parameters
  274.     ;
  275.     set Option   = $($1)
  276.     set SrcDir   = $($2)
  277.     set AddCopy  = $($3)
  278.     set DoCopy   = $($4)
  279.     set DoConfig = $($5)
  280.  
  281.     ;
  282.     ; Check if the language requested is supported
  283.     ;
  284.     set LanguageList = ^(LanguagesSupported, 1)
  285.     Ifcontains(i) $($0) NOT-IN $(LanguageList)
  286.         Return STATUS_NOLANGUAGE
  287.     endif
  288.  
  289.     set-subst LF = "\n"
  290.  
  291.     read-syms GeneralConstants
  292.     read-syms FileConstants
  293.  
  294.     read-syms DialogConstants$(!STF_LANGUAGE)
  295.     ifstr(i) $(!NTN_Origination) == "NCPA"
  296.         set Continue = $(OK)
  297.     endif
  298.     read-syms FileConstants$(!STF_LANGUAGE)
  299.  
  300.     detect date
  301.  
  302.     set-title  $(FunctionTitle)
  303.  
  304.     set to   = Begin
  305.     set from = Begin
  306. ;
  307. ;  Assume all is well.
  308. ;
  309.     set CommonStatus = STATUS_SUCCESSFUL
  310.  
  311.     EndWait
  312.  
  313. ;
  314. ;   Set up the operation-mode-based variables and gaily welcome
  315. ;   the user.  If the "install mode" variable is improperly set,
  316. ;   assume this is a new installation.
  317. ;
  318.  
  319. Begin = +
  320.     Set ActivateDetection = FALSE
  321.  
  322.     Ifstr(i) $(!NTN_InstallMode) == deinstall
  323.         set StartLabel = removeadapter
  324.     else-Ifstr(i) $(!NTN_InstallMode) == Update
  325.         set StartLabel = UpgradeSoftware
  326.     else-Ifstr(i) $(!NTN_InstallMode) == bind
  327.         set StartLabel = bindingadapter
  328.     else-Ifstr(i) $(!NTN_InstallMode) == configure
  329. ;        set ActivateDetection = TRUE
  330.         set StartLabel = configureadapter
  331.         ;
  332.         ;   You cannot config the software component
  333.         ;
  334.         Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  335.             Debug-Output "Cannot configure the Elink II driver software."
  336.             Shell $(UtilityInf),RegistryErrorString,CANNOT_CONFIGURE_SOFTWARE
  337.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  338.                 Debug-Output "ShellCode error: cannot get an error string."
  339.                 goto ShellCodeError
  340.             endif
  341.             set Error = $($R0)
  342.             set from = end
  343.             set to = end
  344.             goto nonfatalinfo
  345.         endif
  346.     else
  347. ;        set ActivateDetection = TRUE
  348.         set StartLabel = installadapter
  349.         set OEM_ABANDON_OPTIONS = {}
  350.         set OEM_ABANDON_SOFTWARE = FALSE
  351.         set OEM_ABANDON_ON = TRUE
  352.     endif
  353.  
  354.  
  355.  
  356.     ;  set the default values
  357.  
  358.     ; IRQ Level = 3
  359.     set IRQValue = *($(IRQList), 2)
  360.  
  361.     ; IOBase Address = 0x300
  362.     set IOBaseAddrValue = *($(IOBaseAddrList), 1)
  363.  
  364.     ; DMAChannel =
  365.     set DMAChannelValue = *($(DMAChannelList), 1)
  366.  
  367.     set CardTypeValue = 0
  368.  
  369.     Set from = $(fatal)
  370.     Set to = $(fatal)
  371.     Goto $(StartLabel)
  372.  
  373. ;-----------------------------------------------
  374. ; Installation Section
  375. ;-----------------------------------------------
  376.  
  377. installadapter = +
  378. ;
  379. ;   First, check whether the same version of the software exists
  380. ;
  381.     OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  382.  
  383.     Ifstr $(KeyProduct) != $(KeyNull)
  384.         ;
  385.         ; Same version already existed in the local machine
  386.         ; Popup the dialog and ask the user whether he wants to continue
  387.         ;
  388.         CloseRegKey $(KeyProduct)
  389.  
  390.         ifstr(i) !(NTN_RegBase) == $(ProductKeyName)
  391.            ;
  392.            ; Cannot Install the same software again
  393.            ;
  394.            Shell $(UtilityInf), VerExistedDlg, $(ProductSoftwareTitle),+
  395.                $(ProductVersion)
  396.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  397.                Debug-Output "ShellCode error: cannot get an error string."
  398.                goto ShellCodeError
  399.            endif
  400.  
  401.            goto end
  402.         else
  403.            ;
  404.            ; Add a new adapter card?
  405.            ;
  406.            Shell $(UtilityInf), CardExistedDlg
  407.  
  408.            ifint $($ShellCode) != $(!SHELL_CODE_OK)
  409.                Debug-Output "ShellCode error: cannot get an error string."
  410.                goto ShellCodeError
  411.            endif
  412.  
  413.            ifstr(i) $($R1) != "OK"
  414.                goto end
  415.            endif
  416.            set OldVersionExisted = $(TRUE)
  417.         endif
  418.     endif
  419.  
  420. ;
  421. ;  dll load addition
  422. ;
  423.     Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  424.  
  425.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  426.         Goto ShellCodeError
  427.     Else-Ifstr(i) $($R0) == STATUS_FAILED
  428.         Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  429.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  430.             goto ShellCodeError
  431.         endif
  432.         set Error = $($R0)
  433.         Goto fatal
  434.     Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  435.         Goto successful
  436.     Endif
  437.  
  438.     Set SrcDir = $($R1)
  439.  
  440.     install "Install-Dll"
  441.  
  442.     goto adaptersetup
  443.  
  444. ;-----------------------------------------------
  445. ; Configuration Section
  446. ;-----------------------------------------------
  447. ;
  448. ;   Get the current values of all the parameters
  449. ;
  450. configureadapter = +
  451.     Ifstr $(KeyProduct) == $(KeyNull)
  452.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) $(MAXIMUM_ALLOWED) KeyProduct
  453.         Ifstr $(KeyProduct) == $(KeyNull)
  454.             set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  455.             Debug-Output "Cannot find component product key"
  456.             goto fatalregistry
  457.         Endif
  458.     Endif
  459.  
  460.     ;
  461.     ; Get the other parameters;  they're attached to the service parameters key
  462.     ;
  463.     Debug-Output "INF: Shelling to FindService"
  464.     Shell $(UtilityInf) FindService, $(KeyProduct)
  465.     Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  466.         Debug-Output "INF: FindService shell failure"
  467.         Goto ShellCodeError
  468.     Endif
  469.     Ifstr(i) $($R0) != NO_ERROR
  470.         Debug-Output "INF: FindService Shell error: "$($R0)
  471.         Goto fatalregistry
  472.     endif
  473.  
  474.     Set KeyParameters = $($R2)
  475.  
  476.     ;
  477.     ;  We don't need the services key, so close it.
  478.     ;
  479.     CloseRegKey $($R1)
  480.  
  481.     Ifstr $(KeyParameters) == $(KeyNull)
  482.         set RegistryErrorIndex = CANNOT_FIND_COMPONENT_SERVICE
  483.         Debug-Output "Cannot find component service"
  484.         goto fatalregistry
  485.     endif
  486.  
  487.     set OldVersionExisted = $(TRUE)
  488.  
  489.     set ValueName = ""
  490.     set ValueData = ""
  491.     set ValueStr  = ""
  492.     set ValueList = {}
  493.  
  494.  
  495.     ;
  496.     ; Get the old values
  497.     ;
  498.     EnumRegValue $(KeyParameters) ValueList
  499.  
  500.     ForListDo $(ValueList)
  501.     set ValueItem = $($)
  502.     set ValueName = *($(ValueItem),1)
  503.     set ValueData = *($(ValueItem),4)
  504.     ifstr(i) $(ValueName) == "CardType"
  505.         set CardTypeValue = $(ValueData)
  506.     else-ifstr(i) $(ValueName) == "IoBaseAddress"
  507.         set IOBaseAddrIndex = $(ValueData)
  508.         else-ifstr(i) $(ValueName) == "SlotNumber"
  509.         set DMAChannelIndex = $(ValueData)
  510.     endif
  511.  
  512.     EndForListDo
  513.  
  514.  
  515.     Debug-Output $(InfName)" CardType is "$(CardTypeValue)
  516.  
  517.  
  518.  
  519.     Ifint $(CardTypeValue) == 0
  520.         Set RadioIn = {1}
  521.     Else-Ifint $(CardTypeValue) == 1
  522.         Set RadioIn = {2}
  523.     Else-Ifint $(CardTypeValue) == 2
  524.         Set RadioIn = {3}
  525.     Endif
  526.  
  527.  
  528.  
  529.     set IRQValue = *($(IRQList), ~($(IRQValues),$(IRQValueIndex)))
  530.     ifstr(i) $(IRQValue) == ""
  531.     set IRQValue = *($(IRQList), 2)
  532.     endif
  533.  
  534.     Debug-Output $(InfName)" IRQ_Level is "$(IRQValue)
  535.  
  536.     set DMAChannelValue = *($(DMAChannelList), ~($(DMAChannelValues),$(DMAChannelIndex)))
  537.     ifstr(i) $(DMAChannelValue) == ""
  538.     set DMAChannelValue = *($(DMAChannelList), 2)
  539.     endif
  540.  
  541.     Debug-Output $(InfName)" DMA is "$(DMAChannelValue)
  542.  
  543.     set IOBaseAddrValue = *($(IOBaseAddrList), ~($(IOBaseAddrValues),$(IOBaseAddrIndex)))
  544.  
  545.     ifstr(i) $(IOBaseAddrValue) == ""
  546.     set IOBaseAddrValue = *($(IOBaseAddrList), 1)
  547.     endif
  548.  
  549.     Debug-Output $(InfName)" I/o base is "$(IOBaseAddrValue)
  550.  
  551.  
  552.  
  553.  
  554.  
  555.     ;  Save the settings as they were read from the Registry.
  556.  
  557. ;    Shell $(ParamInf) Param_SaveValues
  558. ;    Set CurrParamSettings = $($R0)
  559. ;
  560. ;   Put up the adapter configuration dialog if necessary.
  561. ;
  562. ;   Note that $(CurrParamSettings) has the old known parameter values.
  563. ;
  564. adaptersetup = +
  565.  
  566.  
  567. ;    Shell "" DebugConfiguration "before displaying dialog"
  568.  
  569.     Set from = adapteroptions
  570.  
  571.  
  572. adapteroptions = +
  573.  
  574.  
  575.     LoadLibrary "Disk 1" $(DialogDllName) hLib
  576.  
  577.     read-syms FileDependentDlg$(!STF_LANGUAGE)
  578.  
  579.     Debug-Output $(InfName)" CardType is "$(CardTypeValue)
  580.     Debug-Output $(InfName)" DMA is "$(DMAChannelValue)
  581.     Debug-Output $(InfName)" I/o base is "$(IOBaseAddrValue)
  582.  
  583.  
  584.  
  585.     ui start "InputDlg"  $(hLib)
  586.  
  587.     set ExitButton      = $(ButtonPressed)
  588.  
  589.     Debug-Output " ButtonPressed "$(ButtonPressed)
  590.  
  591.  
  592.     FreeLibrary $(hLib)
  593.  
  594.     ifstr(i) $(DLGEVENT) == "CONTINUE"
  595.         set IRQValueIndex = $(Combo1Out)
  596.         set IOBaseAddrIndex = $(Combo2Out)
  597.                 set DMAChannelIndex = $(Combo3Out)
  598.                 set ExitButton      = $(ButtonPressed)
  599.  
  600.                 set CardTypeIndex = *($(RadioOut),1)
  601.  
  602.                 Debug-Output $(InfName)" CardTypeindex is "$(CardTypeIndex)
  603.  
  604.                 Ifint $(CardTypeIndex) == 1
  605.                     Set CardTypeValue = 0
  606.                 else-Ifint $(CardTypeIndex) == 2
  607.                     Set CardTypeValue = 1
  608.                 else-Ifint $(CardTypeIndex) == 3
  609.                     Set CardTypeValue = 2
  610.                 Endif
  611.  
  612.  
  613.  
  614.         ui pop 1
  615. ;        goto nextstep
  616.     else-ifstr(i) $(DLGEVENT) == "EXIT"
  617.         set CommonStatus = STATUS_USERCANCEL
  618.         Debug-Output "Action: exit. Bye."
  619.         ui pop 1
  620.         goto end
  621.     else
  622.         ;
  623.         ; Unknow command
  624.         ;
  625.         ui pop 1
  626.  
  627.                 Set DlgTemplate = "RANDOM2"
  628.                 LoadLibrary "Disk 1" $(DialogDllName) hLib
  629.                 ui start "InputDlg"  $(hLib)
  630.                 FreeLibrary $(hLib)
  631.                 ui pop 1
  632.  
  633. ;        Debug-Output "Action: unknown. Bye."
  634. ;        goto end
  635.     endif
  636.  
  637.  
  638.     Debug-Output " Combo list out "$(ComboListItemsOut)
  639.  
  640.  
  641. ;
  642. ;   If installing, go create the necessary keys;
  643. ;   if configuring, they're already open.
  644. ;
  645. skipoptions =+
  646.  
  647.     ifint $(OldVersionExisted) == $(TRUE)
  648.         ifstr(i) $(!NTN_InstallMode) == configure
  649.             goto writeparameters
  650.         endif
  651.     endif
  652.     StartWait
  653.     ;
  654.     ; Add Software Component
  655.     ;
  656.     ifint $(OldVersionExisted) == $(FALSE)
  657.  
  658.         ifstr(i) $(!NTN_InstallMode) == "install"
  659.            Ifstr(i) $(DoCopy) == "YES"
  660.  
  661.               Shell $(UtilityInf), DoAskSource, $(!STF_CWDDIR), $(SrcDir) YES
  662.  
  663.               Ifint $($ShellCode) != $(!SHELL_CODE_OK)
  664.                   Goto ShellCodeError
  665.               Else-Ifstr(i) $($R0) == STATUS_FAILED
  666.                   Shell $(UtilityInf) RegistryErrorString "ASK_SOURCE_FAIL"
  667.                   ifint $($ShellCode) != $(!SHELL_CODE_OK)
  668.                       goto ShellCodeError
  669.                   endif
  670.                   set Error = $($R0)
  671.                   Goto fatal
  672.               Else-Ifstr(i) $($R0) == STATUS_USERCANCEL
  673.                   Goto successful
  674.               Endif
  675.  
  676.               Set SrcDir = $($R1)
  677.  
  678.            Endif
  679.  
  680.            install "Install-Option"
  681.  
  682.            ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  683.               Shell $(UtilityInf) RegistryErrorString "UNABLE_COPY_FILE"
  684.               ifint $($ShellCode) != $(!SHELL_CODE_OK)
  685.                   goto ShellCodeError
  686.               endif
  687.               set Error = $($R0)
  688.               goto fatal
  689.            endif
  690.         endif
  691.  
  692.  
  693.  
  694.         Shell $(UtilityInf), AddSoftwareComponent, $(Manufacturer), +
  695.             $(ProductSoftwareName), +
  696.             $(ProductSoftwareName), +
  697.             $(ProductSoftwareTitle), $(STF_CONTEXTINFNAME), +
  698.             $(ProductSoftwareImagePath), "kernel", "NDIS", {}, "",+
  699.             $(NetEventDLL)
  700.  
  701.         Set OEM_ABANDON_SOFTWARE = TRUE
  702.  
  703.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  704.             Debug-Output "ShellCode error"
  705.             goto ShellCodeError
  706.         endif
  707.         ;
  708.         ;   At this point:
  709.         ;     $R1 contains the product version key handle;
  710.         ;     $R2 contains the NetRules subkey handle;
  711.         ;     $R3 contains the new Services key handle; and
  712.         ;     $R4 contains the Parameters key
  713.         ;     $R5 contains the Linkage Key
  714.         ;
  715.         set RegistryErrorIndex = $($R0)
  716.         set KeyProduct      = $($R1)
  717.         Set SoftNetRulesKey = $($R2)
  718.         CloseRegKey $($R3)
  719.         CloseRegKey $($R4)
  720.         CloseRegKey $($R5)
  721.  
  722.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  723.             EndWait
  724.             Debug-Output "Registry error: add software components"
  725.             CloseRegKey $(KeyProduct)
  726.             CloseRegKey $(SoftNetRulesKey)
  727.             goto fatalregistry
  728.         endif
  729.  
  730.         set NewValueList = {{SoftwareType,$(NoTitle),$(!REG_VT_SZ),$(SoftwareType)},+
  731.                            {MajorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMajorVersion)},+
  732.                            {MinorVersion,$(NoTitle),$(!REG_VT_DWORD),$(ProductMinorVersion)},+
  733.                            {Title,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareTitle)},+
  734.                            {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareDescription)},+
  735.                            {ServiceName,$(NoTitle),$(!REG_VT_SZ),$(ProductSoftwareName)},+
  736.                            {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  737.  
  738.         Shell  $(UtilityInf), AddValueList, $(KeyProduct), $(NewValueList)
  739.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  740.             Debug-Output "ShellCode error."
  741.             goto ShellCodeError
  742.         endif
  743.  
  744.         set RegistryErrorIndex = $($R0)
  745.  
  746.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  747.             EndWait
  748.             Debug-Output "Registry error: add value list."
  749.             CloseRegKey $(KeyProduct)
  750.             CloseRegKey $(SoftNetRulesKey)
  751.             goto fatalregistry
  752.         endif
  753.  
  754.         set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareType)},+
  755.                             {use,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareUse)}, +
  756.                             {bindform,$(NoTitle),$(!REG_VT_SZ),$(NetRuleSoftwareBindForm)}, +
  757.                             {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareClass)}, +
  758.                             {bindable,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleSoftwareBindable)}, +
  759.                             {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  760.  
  761.         Shell  $(UtilityInf), AddValueList, $(SoftNetRulesKey), $(NewValueList)
  762.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  763.             Debug-Output "ShellCode error."
  764.             goto ShellCodeError
  765.         endif
  766.  
  767.         set RegistryErrorIndex = $($R0)
  768.  
  769.         CloseRegKey $(KeyProduct)
  770.         CloseRegKey $(SoftNetRulesKey)
  771.  
  772.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  773.             EndWait
  774.             Debug-Output "Resgitry error: add value list."
  775.             goto fatalregistry
  776.         endif
  777.     endif
  778. ;
  779. ;   Create the HARDWARE\Netcard region and its corresponding service
  780. ;
  781.     Shell $(UtilityInf), AddHardwareComponent, $(ProductHardwareName),$(STF_CONTEXTINFNAME),$(ProductKeyName)
  782.  
  783.     ifint $($R4) != -1
  784.         Set OEM_ABANDON_OPTIONS = >($(OEM_ABANDON_OPTIONS), $(!NTN_SoftwareBase)"\Microsoft\Windows NT\CurrentVersion\NetworkCards\"$($R4))
  785.     endif
  786.  
  787.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  788.         Debug-Output "Cannot add hardware component"
  789.         goto ShellCodeError
  790.     endif
  791.  
  792.     set RegistryErrorIndex = $($R0)
  793.  
  794.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  795.         EndWait
  796.         Debug-Output "Registry error: add hardware component"
  797.         CloseRegKey $($R1)
  798.         CloseRegKey $($R2)
  799.         CloseRegKey $($R3)
  800.         goto fatalregistry
  801.     endif
  802.  
  803. ;
  804. ;   At this point:
  805. ;     $R1  Registry key variable for HARDWARE\Netcard\(n)
  806. ;     $R2  Registry key variable for HARDWARE\Netcard\(n)\\NetRules
  807. ;     $R3  Registry key handle for <service>\Parameters key
  808. ;     $R4  Adapter number assigned to adapter
  809. ;     $R5  Service name generated by combining svc name with adapter number
  810. ;
  811.     set KeyParameters = $($R3)
  812.     set KeyAdapterRules = $($R2)
  813.     set AdapterNumber = $($R4)
  814.  
  815.     set NewValueList = {{Manufacturer,$(NoTitle),$(!REG_VT_SZ),$(Manufacturer)},+
  816.                        {Title,$(NoTitle),$(!REG_VT_SZ),"["$($R4)"] "$(ProductHardware$(Option)Title)},+
  817.                        {Description,$(NoTitle),$(!REG_VT_SZ),$(ProductHardware$(Option)Description)},+
  818.                        {ProductName,$(NoTitle),$(!REG_VT_SZ),$(ProductHardwareName)},+
  819.                        {ServiceName,$(NoTitle),$(!REG_VT_SZ),$($R5)},+
  820.                        {InstallDate,$(NoTitle),$(!REG_VT_DWORD),*($(Now),1)}}
  821.  
  822.     Shell  $(UtilityInf), AddValueList, $($R1), $(NewValueList)
  823.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  824.         Debug-Output "ShellCode error"
  825.         goto ShellCodeError
  826.     endif
  827.  
  828.     CloseRegKey $($R1)
  829.  
  830.     set TempProdName = """"$(ProductHardwareName)$(AdapterNumber)""""
  831.     set TempBindForm = $(TempProdName)$(NetRuleHardwareBindForm)
  832.  
  833.     set NewValueList = {{type,$(NoTitle),$(!REG_VT_SZ),$(NetRuleHardwareType)},+
  834.                         {bindform,$(NoTitle),$(!REG_VT_SZ),$(TempBindForm)}, +
  835.                         {class,$(NoTitle),$(!REG_VT_MULTI_SZ),$(NetRuleHardwareClass)}, +
  836.                         {InfOption,$(NoTitle),$(!REG_VT_SZ),$(Option)}}
  837.  
  838.     Shell  $(UtilityInf), AddValueList, $(KeyAdapterRules), $(NewValueList)
  839.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  840.         Debug-Output "ShellCode error."
  841.         goto ShellCodeError
  842.     endif
  843.  
  844.     set RegistryErrorIndex = $($R0)
  845.  
  846.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  847.         EndWait
  848.         Debug-Output "Resgitry error: add value list."
  849.         CloseRegKey $(KeyParameters)
  850.         CloseRegKey $(KeyAdapterRules)
  851.         goto fatalregistry
  852.     endif
  853.  
  854.     CloseRegKey $(KeyAdapterRules)
  855.  
  856.     goto writeparameters
  857. ;
  858. ;   REQUIRED:   $(KeyParameters) contains service Parameters key handle
  859. ;
  860. writeparameters = +
  861.     Shell $(UtilityInf), GetBusTypeNum
  862.     set BusTypeNum = $($R1)
  863.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  864.         Debug-Output "ShellCode error."
  865.         goto ShellCodeError
  866.     endif
  867. ;
  868. ;   Add the rest of the parameters to the Services area
  869. ;
  870. ;    Set NewValueList = {{Transceiver,$(NoTitle),$(!REG_VT_DWORD),$(TransceiverValue)},+
  871. ;                       {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
  872. ;                       {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  873. ;                       {MemoryMapped,$(NoTitle),$(!REG_VT_DWORD),$(MappedValue)},+
  874. ;                       {InterruptNumber,$(NoTitle),$(!REG_VT_DWORD),$(IRQ_Level)},+
  875. ;                       {IoBaseAddress,$(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)}}
  876. ;
  877.  
  878.     set DMAChannelValue = *($(DMAChannelValues), ~($(DMAChannelList),$(DMAChannelIndex)))
  879.  
  880.     set IRQValue = *($(IRQValues), ~($(IRQList),$(IRQValueIndex)))
  881.  
  882.     set IOBaseAddrValue = *($(IOBaseAddrValues), ~($(IOBaseAddrList),$(IOBaseAddrIndex)))
  883.  
  884.  
  885.     set NewValueList = {{CardType,$(NoTitle),$(!REG_VT_DWORD),$(CardTypeValue)},+
  886.                         {BusType,$(NoTitle),$(!REG_VT_DWORD),$(BusTypeNum)},+
  887.                         {MediaType,$(NoTitle),$(!REG_VT_DWORD),1},+
  888.                 {IoBaseAddress,  $(NoTitle),$(!REG_VT_DWORD),$(IOBaseAddrValue)},+
  889.                         {SlotNumber,     $(NoTitle),$(!REG_VT_DWORD),$(DMAChannelValue)}}
  890.  
  891.  
  892.     Shell  $(UtilityInf), AddValueList, $(KeyParameters), $(NewValueList)
  893.  
  894.     CloseRegKey $(KeyParameters)
  895.  
  896.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  897.         Debug-Output "ShellCode error."
  898.         goto ShellCodeError
  899.     endif
  900.  
  901.     set RegistryErrorIndex = $($R0)
  902.  
  903.     Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  904.         Debug-Output "Registry error: Add value list"
  905.         goto fatalregistry
  906.     endif
  907.  
  908.     EndWait
  909.  
  910.     goto successful
  911.  
  912. ;-----------------------------------------------
  913. ; Binding section
  914. ;-----------------------------------------------
  915. bindingadapter =+
  916.     set Error = "Binding: Sorry, not yet implemented."
  917.     goto fatal
  918.  
  919. ;-----------------------------------------------
  920. ; Removeadapter section
  921. ;-----------------------------------------------
  922.  
  923. removeadapter = +
  924.     Ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  925.         ; Remove Software Component
  926.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  927.             $(ProductSoftwareName)
  928.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  929.             Debug-Output "ShellCode error"
  930.             goto ShellCodeError
  931.         endif
  932.  
  933.         set RegistryErrorIndex = $($R0)
  934.  
  935.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  936.             goto fatalregistry
  937.         endif
  938.     else
  939.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  940.             $(ProductSoftwareName), $(!NTN_RegBase)
  941.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  942.             Debug-Output "ShellCode error"
  943.             goto ShellCodeError
  944.         endif
  945.  
  946.         set RegistryErrorIndex = $($R0)
  947.  
  948.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  949.             goto fatalregistry
  950.         endif
  951.     endif
  952.  
  953.     goto end
  954.  
  955. ;-----------------------------------------------
  956. ; Upgrade Software section
  957. ;-----------------------------------------------
  958.  
  959. UpgradeSoftware = +
  960.     ;
  961.     ; First determine whether we want to do upgrade or update for software
  962.     ; or hardware component. Then we will determine whether the Mode is
  963.     ; update or upgrade.
  964.     ;
  965.     ; If the same version of the product existed in the registry, we do
  966.     ; update. Otherwise, we will do a upgrade
  967.     ;
  968.     ifstr(i) $(ProductKeyName) == $(!NTN_RegBase)
  969.         ; Upgrade software component
  970.         ;
  971.         ; see whether the same version exist or not
  972.         ;
  973.         OpenRegKey $(!REG_H_LOCAL) "" $(ProductKeyName) $(MAXIMUM_ALLOWED) KeyProduct
  974.  
  975.         Ifstr $(KeyProduct) != $(KeyNull)
  976.             GetRegValue $(KeyProduct),"MajorVersion", VersionInfo
  977.             set Version = *($(VersionInfo), 4)
  978.  
  979.             ;
  980.             ; Update the binaries
  981.             ;
  982.             Shell $(UtilityInf), GetInfFileNameFromRegistry, $(KeyProduct)
  983.  
  984.             ifint $($ShellCode) != $(!SHELL_CODE_OK)
  985.                 Debug-Output "ShellCode error"
  986.                 goto ShellCodeError
  987.             endif
  988.  
  989.             set !UG_Filename = $($R0)
  990.  
  991.             ifstr(i) $(!UG_Filename) != ""
  992.                 install "Install-Update"
  993.                 ifstr(i) $(STF_INSTALL_OUTCOME) != STF_SUCCESS
  994.                     goto fatal
  995.                 endif
  996.             endif
  997.  
  998.             ; Upgrade the version number
  999.             ;
  1000.             SetRegValue $(KeyProduct) {MajorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMajorVersion)}
  1001.             SetRegValue $(KeyProduct) {MinorVersion,$(NoTitle),$(!REG_VT_SZ),$(ProductMinorVersion)}
  1002.  
  1003.             ;
  1004.             ; do nothing for update
  1005.             ;
  1006.             ifint $(Version) != $(ProductVersion)
  1007.                ;
  1008.                ; If the major version number is not the same,
  1009.                ; it is major upgrade. So let Upgrade the product
  1010.                ;
  1011.                ;
  1012.                ; make other upgrade change if necessary
  1013.                ;
  1014.             endif
  1015.             CloseRegKey $(KeyProduct)
  1016.         else
  1017.             ;
  1018.             ; Cannot Open software key, goto ERROR
  1019.             ;
  1020.             goto fatalregistry
  1021.         endif
  1022.     else
  1023.         ;
  1024.         ; upgrade/update hardware component
  1025.         ; There is no different between upgrade and update for hardware
  1026.         ; component
  1027.         ;
  1028.         ; 1. Get the Service Name
  1029.         ; 2. Change the NetRule section if necessary
  1030.         ;
  1031.         OpenRegKey $(!REG_H_LOCAL) "" $(!NTN_RegBase) +
  1032.               $(MAXIMUM_ALLOWED) NetworkCardKey
  1033.         Ifstr(i) $(NetworkCardKey) != $(KeyNull)
  1034.             ;
  1035.             ; Get Service name
  1036.             ;
  1037.             GetRegValue $(NetworkCardKey),"ServiceName", ServiceNameInfo
  1038.             set ServiceName = *($(ServiceNameInfo), 4)
  1039.  
  1040.             ;
  1041.             ; Change the NetRule if necessary
  1042.             ;
  1043.             OpenRegKey $(NetworkCardKey) "" "NetRules" +
  1044.                 $(MAXIMUM_ALLOWED) NetRuleKey
  1045.             Ifstr(i) $(NetRuleKey) != $(KeyNull)
  1046.                 ;
  1047.                 ; Make the change....
  1048.                 ;
  1049.             else
  1050.                 ;
  1051.                 ; Error, cannot open net rules key
  1052.                 ;
  1053.                 goto fatalregistry
  1054.             endif
  1055.  
  1056.             CloseRegKey $(NetRules)
  1057.             CloseRegKey $(NetworkCardKey)
  1058.         else
  1059.             ;
  1060.             ; Error, cannot open network card key
  1061.             ;
  1062.             goto fatalregistry
  1063.         endif
  1064.         ;
  1065.         ; 3. Change the service section of the hardware. i.e.,
  1066.         ;    ParameterName change, value change, etc.
  1067.         ;
  1068.         OpenRegKey $(!REG_H_LOCAL) "" +
  1069.               $(!NTN_ServiceBase)"\"$(ServiceName) +
  1070.               $(MAXIMUM_ALLOWED) ServiceKey
  1071.  
  1072.         Ifstr(i) $(ServiceKey) != $(KeyNull)
  1073.             ;
  1074.             ; Get the ServiceKey to change the Start value
  1075.             ; or Type value. Or open Parameters key to
  1076.             ; change the hardware parameters if necessary.
  1077.             ;
  1078.             CloseRegKey $(ServiceKey)
  1079.         else
  1080.             ;
  1081.             ; Error, cannot open network card key
  1082.             ;
  1083.             goto fatalregistry
  1084.         endif
  1085.     endif
  1086.  
  1087.     goto end
  1088.     ;
  1089.     ; End of Upgrade Software
  1090.     ;
  1091.  
  1092. ;
  1093. ;  Escape hatches
  1094. ;
  1095. successful = +
  1096.     goto end
  1097.  
  1098. abandon = +
  1099.     ForListDo $(OEM_ABANDON_OPTIONS)
  1100.         Shell $(UtilityInf), RemoveHardwareComponent, $(Manufacturer), +
  1101.             $(ProductSoftwareName), $($)
  1102.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1103.             Debug-Output "ShellCode error"
  1104.             goto ShellCodeError
  1105.         endif
  1106.  
  1107.         set RegistryErrorIndex = $($R0)
  1108.  
  1109.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1110.             goto fatalregistry
  1111.         endif
  1112.     EndForListDo
  1113.  
  1114.     Ifstr(i) $(OEM_ABANDON_SOFTWARE) == TRUE
  1115.         ; Remove Software Component
  1116.         Shell $(UtilityInf), RemoveSoftwareComponent, $(Manufacturer), +
  1117.             $(ProductSoftwareName), FALSE
  1118.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1119.             Debug-Output "ShellCode error"
  1120.             goto ShellCodeError
  1121.         endif
  1122.  
  1123.         set RegistryErrorIndex = $($R0)
  1124.  
  1125.         Ifstr(i) $(RegistryErrorIndex) != NO_ERROR
  1126.             goto fatalregistry
  1127.         endif
  1128.     endif
  1129.  
  1130.     goto end
  1131.  
  1132. ;
  1133. ; warning display
  1134. ;
  1135. warning = +
  1136.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "WARNING", $(Error)
  1137.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1138.         goto ShellCodeError
  1139.     endif
  1140.     ifstr(i) $($R1) == "OK"
  1141.         goto $(to)
  1142.     else-ifstr(i) $($R1) == "CANCEL"
  1143.         goto $(from)
  1144.     else
  1145.         goto "end"
  1146.     endif
  1147. ;
  1148. ; non fatal error display
  1149. ;
  1150. nonfatalinfo = +
  1151.     Set Severity = STATUS
  1152.     Set CommonStatus = STATUS_USERCANCEL
  1153.     goto nonfatalmsg
  1154. nonfatal = +
  1155.     Set Severity = NONFATAL
  1156.     goto nonfatalmsg
  1157. nonfatalmsg = +
  1158.     ifstr(i) $(Error) == ""
  1159.         Set Severity = NONFATAL
  1160.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1161.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1162.             goto ShellCodeError
  1163.         endif
  1164.         set Error = $($R0)
  1165.     endif
  1166.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), $(Severity), $(Error)
  1167.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1168.         goto ShellCodeError
  1169.     endif
  1170.     ifstr(i) $($R1) == "OK"
  1171.         goto $(from)
  1172.     else
  1173.         goto "end"
  1174.     endif
  1175.  
  1176. ;
  1177. ;  Registry is broken
  1178. ;
  1179. fatalregistry = +
  1180.     Shell $(UtilityInf) RegistryErrorString $(RegistryErrorIndex)
  1181.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1182.         goto ShellCodeError
  1183.     endif
  1184.     set Error = $($R0)
  1185.     goto fatal
  1186. ;
  1187. ;  Netcard detection failure
  1188. ;
  1189. fataldetect = +
  1190.     Shell $(UtilityInf),RegistryErrorString,CANNOT_DETECT
  1191.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1192.         Debug-Output "ShellCode error: cannot get an error string."
  1193.         goto ShellCodeError
  1194.     endif
  1195.     set Error = $($R0)
  1196.     Goto fatal
  1197. ;
  1198. ; fatal error display
  1199. ;
  1200. fatal = +
  1201.     ifstr(i) $(Error) == ""
  1202.         Shell $(UtilityInf) RegistryErrorString "SETUP_FAIL"
  1203.         ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1204.             goto ShellCodeError
  1205.         endif
  1206.         set Error = $($R0)
  1207.     endif
  1208.     Shell $(subroutineinf) SetupMessage, $(!STF_LANGUAGE), "FATAL", $(Error)
  1209.     ifint $($ShellCode) != $(!SHELL_CODE_OK)
  1210.         goto ShellCodeError
  1211.     endif
  1212.  
  1213.     goto setfailed
  1214.  
  1215. ;
  1216. ;  Shelling error
  1217. ;
  1218. ShellCodeError = +
  1219.     set DlgType      = "MessageBox"
  1220.     set STF_MB_TITLE = $(ShellCodeErrorTitle)
  1221.     set STF_MB_TEXT  = $(ShellCodeErrorText) 
  1222.     set STF_MB_TYPE  = 1
  1223.     set STF_MB_ICON  = 3
  1224.     set STF_MB_DEF   = 1
  1225.     ui start "Error Message"
  1226.     goto setfailed
  1227.  
  1228. setfailed = +
  1229.     set CommonStatus = STATUS_FAILED
  1230.     ;
  1231.     ; if OEM_ABANDON_ON == TRUE, then remove the registry entries
  1232.     ;
  1233.     ifstr(i) $(OEM_ABANDON_ON) == TRUE
  1234.         set OEM_ABANDON_ON = FALSE
  1235.         goto abandon
  1236.     endif
  1237.     goto end
  1238.  
  1239. end = +
  1240.     goto term
  1241.  
  1242. term = +
  1243.  
  1244.     Return $(CommonStatus)
  1245.  
  1246. [DebugConfiguration]
  1247.  
  1248.     Set InfName = "OEMNADE2.INF"
  1249.     Debug-Output $(InfName)" **CONFIGURATION STATE: "$($0)
  1250.     Debug-Output $(InfName)" IRQ_Level is "$(!p:IRQ_Level)
  1251.     Debug-Output $(InfName)" IOBaseAddrValue is "$(!p:IOBaseAddrValue)
  1252.     Debug-Output $(InfName)" TransceiverValue is "$(!p:TransceiverValue)
  1253.     Debug-Output $(InfName)" MemBaseAddrDec is "$(!p:MemBaseAddrDec)
  1254.     Debug-Output $(InfName)" MappedValue is "$(!p:MappedValue)
  1255.  
  1256.     return
  1257.  
  1258.  
  1259. ;***************************************************************
  1260. ;  INSTALL SECTIONS
  1261. ;***************************************************************
  1262. [Install-Option]
  1263.     set STF_VITAL = ""
  1264.  
  1265.     ifstr(i) $(AddCopy) == "YES"
  1266.  
  1267.         ;
  1268.         ; Add the files to the copy list
  1269.         ;
  1270.         ;  BUGBUG: eliminate the "nt2" in the next line when Sunil fixes
  1271.         ;      the other INF files
  1272.         ;
  1273.         AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1274.  
  1275.     endif
  1276.  
  1277.     ifstr(i) $(DoCopy) == "YES"
  1278.  
  1279.        ;
  1280.        ; Copy files in the copy list
  1281.        ;
  1282.        set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1283.        CopyFilesInCopyList
  1284.  
  1285.     endif
  1286.  
  1287.     Exit
  1288.  
  1289. [Install-Update]
  1290.    set STF_VITAL        = ""
  1291.    set STF_OVERWRITE    = "VERIFYSOURCEOLDER"
  1292.    ;set STF_VERSION     = "YES"
  1293.  
  1294.    AddSectionFilesToCopyList Files-$(Option) $(SrcDir) $(!STF_WINDOWSSYSPATH)\drivers
  1295.    AddSectionFilesToCopyList Files-Inf $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1296.  
  1297.    set !STF_NCPA_FLUSH_COPYLIST = TRUE
  1298.    CopyFilesInCopyList
  1299.  
  1300.    exit
  1301.  
  1302.  
  1303. [Install-Dll]
  1304.    set STF_VITAL     = ""
  1305.    AddSectionFilesToCopyList Files-Dll $(SrcDir) $(!STF_WINDOWSSYSPATH)
  1306.    CopyFilesInCopyList
  1307.    exit
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313. [Source Media Descriptions]
  1314.     1  = "Windows NT Setup Disk #1"  , TAGFILE = disk1
  1315.  
  1316.  
  1317. [ProductType]
  1318. STF_PRODUCT  = Winnt
  1319. STF_PLATFORM = I386
  1320.  
  1321.  
  1322. [Files-Inf]
  1323. 1,    oemsetup.inf,     SIZE=1000,    RENAME=$(!UG_Filename)
  1324.  
  1325. [Files-ELNK3]
  1326. 1, elnk3.SYS , SIZE=88888
  1327.  
  1328. [Files-Dll]
  1329. 1, Pcnetdlg.dll,  SIZE=999
  1330.  
  1331.  
  1332.  
  1333. [LanguagesSupported]
  1334.     ENG
  1335.  
  1336. [OptionsTextENG]
  1337.     ELNK3     = "Etherlink III Ethernet Adapter"
  1338.  
  1339. [FileConstantsENG]
  1340. ProCaption   = "Windows NT Setup"
  1341. ProCancel    = "Cancel"
  1342. ProCancelMsg = "Windows NT Networking is not correctly installed.  "+
  1343.                "Are you sure you want to cancel copying files?"
  1344. ProCancelCap = "Network Setup Message"
  1345. ProText1     = "Copying:"
  1346. ProText2     = "To:"
  1347.  
  1348. FunctionTitle   = $(GenericAdapterName)" Card Setup"$(GenericInfVersion)
  1349.  
  1350. ProductSoftwareDescription = $(GenericDriverName)
  1351. ProductHardwareDescription = $(GenericAdapterName)
  1352.  
  1353. ProductSoftwareTitle =       $(GenericDriverName)
  1354. ProductHardwareELNK3Title =       $(GenericAdapterName)
  1355.  
  1356. DialogDllName   = "pcnetdlg.dll"
  1357.  
  1358.  
  1359. IRQList  = ^(IRQChoices, 1)
  1360. IRQValues = ^(IRQChoices, 2)
  1361.  
  1362. IOBaseAddrList = ^(IOBaseAddrChoices, 1)
  1363. IOBaseAddrValues = ^(IOBaseAddrChoices, 2)
  1364.  
  1365. DMAChannelList = ^(DMAChannelChoices,1)
  1366. DMAChannelValues = ^(DMAChannelChoices,2)
  1367.  
  1368.  
  1369.  
  1370. [DialogConstantsENG]
  1371. Help        = "&Help"
  1372. Exit        = "Cancel"
  1373. OK          = "OK"
  1374. HelpContext = ""
  1375. Continue    = "Continue"
  1376. Cancel      = "Cancel"
  1377.  
  1378. [MemoryMappedChoicesENG]
  1379. Map_1 = 1, "ON"
  1380. Map_2 = 0, "OFF"
  1381.  
  1382. [FileDependentDlgENG]
  1383.  
  1384. DlgText = "Please select values for the follwing fields:"
  1385.  
  1386. ;Combo1Label = "&IRQ Level:"
  1387. ;Combo2Label = "I/O &Port Address:"
  1388. ;CheckBox1   = "&Memory Mapped"
  1389. ;Label1 = "Transceiver Type"
  1390. ;Radio1 = "&External"
  1391. ;Radio2 = "O&n Board"
  1392.  
  1393. DlgType = "RadioCombination"
  1394. DlgTemplate = "ELNKIII"
  1395. Caption = $(FunctionTitle)
  1396.  
  1397.  
  1398. CBOptionsGreyed = {}
  1399. NotifyFields = {NO, NO}
  1400. HelpContext = $(!IDH_DB_OEMNADE2_INS)
  1401.  
  1402. Combo3Label = "&IRQ Level:"
  1403. Combo1Label = "I/O &Port Base Addr:"
  1404. Combo2Label = "Slot Number:"
  1405.  
  1406. BigButton   = "More ELNK3 BS >>"
  1407.  
  1408. Combo1List = $(IRQList)
  1409. Combo1Out  = $(IRQValue)
  1410.  
  1411. Combo2List = $(IOBaseAddrList)
  1412. Combo2Out  = $(IOBaseAddrValue)
  1413.  
  1414. Combo3List = $(DMAChannelList)
  1415. Combo3Out  = $(DMAChannelValue)
  1416.  
  1417.  
  1418. ComboListItemsIn  = {Combo2List,Combo3List}
  1419. ComboListItemsOut = {Combo2Out, Combo3Out}
  1420.  
  1421. EditTextIn = {"ELNK3 text for first edit control",+
  1422.               "ELNK3 text for second edit control"}
  1423.  
  1424. EditTextLim = {"",""}
  1425.  
  1426. Group1 = "Card Type"
  1427.  
  1428. Radio1 = "ISA"
  1429. Radio2 = "EISA"
  1430. Radio3 = "MCA"
  1431.  
  1432.  
  1433.  
  1434. [IRQChoices]
  1435. IRQ_1 = "2",2
  1436. IRQ_2 = "3",3
  1437. IRQ_3 = "4",4
  1438. IRQ_4 = "5",5
  1439.  
  1440. [IOBaseAddrChoices]
  1441. IOBase_1  = "0x200",512
  1442. IOBase_2  = "0x210",528
  1443. IOBase_3  = "0x220",544
  1444. IOBase_4  = "0x230",560
  1445. IOBase_5  = "0x240",576
  1446. IOBase_6  = "0x250",592
  1447. IOBase_7  = "0x260",608
  1448. IOBase_8  = "0x270",624
  1449. IOBase_9  = "0x280",640
  1450. IOBase_10 = "0x290",656
  1451. IOBase_11 = "0x2a0",672
  1452. IOBase_12 = "0x2b0",698
  1453. IOBase_13 = "0x2c0",714
  1454. IOBase_14 = "0x2d0",730
  1455. IOBase_15 = "0x2e0",746
  1456. IOBase_16 = "0x2f0",752
  1457. IOBase_17 = "0x300",768
  1458. IOBase_18 = "0x310",784
  1459. IOBase_19 = "0x320",800
  1460. IOBase_20 = "0x330",816
  1461. IOBase_21 = "0x340",832
  1462. IOBase_22 = "0x350",848
  1463. IOBase_23 = "0x360",864
  1464. IOBase_24 = "0x370",880
  1465. IOBase_25 = "0x380",896
  1466. IOBase_26 = "0x390",912
  1467. IOBase_27 = "0x3a0",928
  1468. IOBase_28 = "0x3b0",944
  1469. IOBase_29 = "0x3c0",960
  1470. IOBase_30 = "0x3d0",976
  1471. IOBase_31 = "0x3e0",992
  1472.  
  1473.  
  1474.  
  1475.  
  1476.  
  1477. [DMAChannelChoices]
  1478. DMAChannel_1 = "1",1
  1479. DMAChannel_2 = "2",2
  1480. DMAChannel_3 = "3",3
  1481. DMAChannel_4 = "4",4
  1482. DMAChannel_5 = "5",5
  1483. DMAChannel_6 = "6",6
  1484. DMAChannel_7 = "7",7
  1485. DMAChannel_8 = "8",8
  1486. DMAChannel_9 = "9",9
  1487. DMAChannel_10= "10",10
  1488. DMAChannel_11= "11",11
  1489. DMAChannel_12= "12",12
  1490. DMAChannel_13= "13",13
  1491. DMAChannel_14= "14",14
  1492. DMAChannel_15= "15",15
  1493. DMAChannel_16= "16",16
  1494.